import { title } from "process";
import { Component, ReactNode } from "react";



class Header extends Component { 
    // 读取游戏卡，children 是固定写法
    props = {
        left:<></>,
        right:<></>,
        children:''
    }

    render(): ReactNode {
        return <header>
             <h1>头部</h1>

            {this.props.left}
            {this.props.children}
            {this.props.right}
            
            </header>
    }

}



export default class App extends Component {

    state = { title: "React" }
    render(): ReactNode {
        return<>
        <div>
            <h1>父组件 -- {this.state.title}</h1>
            <hr />
            <Header left={<del>￥199.99</del>} right={<span>￥99.99</span>}> </Header>
        </div>
        </>
    }

}


